<?php

namespace App\Logging;

use Monolog\Formatter\LineFormatter as BaseLineFormatter;

class LineFormatter extends BaseLineFormatter
{
    const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name% %extra% : %message% %context%\n";

    public function format(array $record)
    {
        $this->includeStacktraces();
        $arr = debug_backtrace();
        $record['extra'][] = $arr[7]['file'] . ':' . $arr[8]['function'] . '():' . $arr[7]['line'];
        return parent::format($record);
    }
}
